<script setup>
const props = defineProps({
  modelValue: {
    type: String,
    default: ''
  },
  placeholder: {
    type: String,
    default: '请选择考试类型'
  },
  allowClear: {
    type: Boolean,
    default: true
  }
})

const emit = defineEmits(['update:modelValue'])

const examTypes = [
  { value: 'ONLINE', label: '在线考试' },
  { value: 'OFFLINE', label: '线下考试' },
  { value: 'MIXED', label: '混合考试' }
]

const handleChange = (value) => {
  emit('update:modelValue', value)
}
</script>

<template>
  <a-select
    :model-value="modelValue"
    :placeholder="placeholder"
    :allow-clear="allowClear"
    @change="handleChange"
  >
    <a-option
      v-for="item in examTypes"
      :key="item.value"
      :value="item.value"
      :label="item.label"
    />
  </a-select>
</template>

<style scoped>
/* 可根据需要添加样式 */
</style>